//
//  UIView+Common.m
//  Coding_My
//
//  Created by showXxie on 2017/8/18.
//  Copyright © 2017年 sooxie. All rights reserved.
//

#import "UIView+Common.h"

@implementation UIView (Common)
- (CGSize)doubleSizeOfFrame{
    CGSize size = self.frame.size;
    return CGSizeMake(size.width*2, size.height*2);
}

- (void)doCircleFrame{
    self.layer.masksToBounds = YES;
    self.layer.cornerRadius = self.frame.size.width/2;
    self.layer.borderWidth = 0.5;
    self.layer.borderColor = kColorDDD.CGColor;
}


//- (void)addLineUp:(BOOL)hasUp andDown:(BOOL)hasDown andColor:(UIColor *)color{
//    [self removeViewWithTag:kTagLineView];
//    if (hasUp) {
//        UIView *upView = [UIView lineViewWithPointYY:0 andColor:color];
//        upView.tag = kTagLineView;
//        [self addSubview:upView];
//    }
//    if (hasDown) {
//        UIView *downView = [UIView lineViewWithPointYY:CGRectGetMaxY(self.bounds)-0.5 andColor:color];
//        downView.tag = kTagLineView;
//        [self addSubview:downView];
//    }
//    return [self addLineUp:hasUp andDown:hasDown andColor:color andLeftSpace:0];
//}
//
//- (void)removeViewWithTag:(NSInteger)tag{
//    for (UIView *aView in [self subviews]) {
//        if (aView.tag == tag) {
//            [aView removeFromSuperview];
//        }
//    }
//}

+ (UIViewAnimationOptions)animationOptionsForCurve:(UIViewAnimationCurve)curve
{
    switch (curve) {
        case UIViewAnimationCurveEaseInOut:
            return UIViewAnimationOptionCurveEaseInOut;
            break;
        case UIViewAnimationCurveEaseIn:
            return UIViewAnimationOptionCurveEaseIn;
            break;
        case UIViewAnimationCurveEaseOut:
            return UIViewAnimationOptionCurveEaseOut;
            break;
        case UIViewAnimationCurveLinear:
            return UIViewAnimationOptionCurveLinear;
            break;
    }
    
    return kNilOptions;
}
@end
